/**
 * 项目名：五位一体化工安全信息平台
 * 日期：    2019-12-08 15:07:44
 * Copyright (c) 2015- joysuch-版权所有
 */

package com.joysuch.wwyt.bp.entity.contractor;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.Proxy;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.time.LocalDate;

import static javax.persistence.GenerationType.IDENTITY;

@EntityListeners({AuditingEntityListener.class, AutoSetCommonFieldListener.class})
@Entity
@Table(name = "wwyt_bp_contractor_staff")
@SQLDelete(sql = "update wwyt_bp_contractor_staff set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update wwyt_bp_contractor_staff set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")
@Data
@Proxy(lazy = false)
public class BpContractorStaff {

    @Id
    @GeneratedValue(strategy = IDENTITY)
    private Long id;
    //承包商人员编号
    private String code;
    //姓名
    private String name;
    //曾用名
    private String oldName;
    //身份（1.员工；2.管理人员）
    private Integer identity;
    //单位ID
    private Long contractorId;
    //性别
    private String gender;
    // 证件类型
    private Long idCardType;
    //联系电话
    private String telephone;
    // 学历
    private Long education;
    // 户籍所在
    private String censusRegister;
    // 通讯地址
    private String address;
    // 参加工作时间
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDate joinWorkDate;
    // 证件照
    private String idCardImgJson;
    // 民族
    private Long nation;
    // 证件号码
    private String idCardNo;
    // 健康状况
    private Long healthStatus;
    // 专业
    private String major;
    // 从业所在地
    private String workAt;
    // 邮编
    private String postcode;
    // 职称/技能等级
    private String title;

    //定位卡号
    private String sn;
    //门禁卡号
    private String cardNumber;
    //头像图标
    private String facePic;
    //外部链接URL
    private String refUrl;

    //是否已和人员在岗在位同步数据 默认0 否; 1 是
    private boolean locateSync;
    //人员在岗在位同步过去后返回的id
    private String employeeId;
    // >=4.x
    private String uniqueId;

    //报警模板id
    private Long alarmTemplateId;

    //报警模板名称
    private String alarmTemplateName;
    //帽子id
    private Long capId;


    @ApiModelProperty("数据状态字段: 0 无效; 1 有效")
    private Integer state;
    //通用字段
    @ApiModelProperty("创建人")
    @org.springframework.data.annotation.CreatedBy
    @JsonIgnore
    private Long createBy;
    @ApiModelProperty("创建时间")
    @org.springframework.data.annotation.CreatedDate
    @JsonIgnore
    private java.time.LocalDateTime createTime;
    @ApiModelProperty("更新人")
    @org.springframework.data.annotation.LastModifiedBy
    @JsonIgnore
    private Long updateBy;
    @ApiModelProperty("更新时间")
    @org.springframework.data.annotation.LastModifiedDate
    @JsonIgnore
    private java.time.LocalDateTime updateTime;
    @ApiModelProperty("租户")
    @JsonIgnore
    private Long tenentId;
    @ApiModelProperty("组织机构代码")
    @JsonIgnore
    private String orgCode;
    @ApiModelProperty("删除标记")
    @JsonIgnore
    private String deleteFlag;

}

